require.config({
    baseUrl: './libs',
    paths: {
      'jquery': 'jquery',
      'underscore': 'underscore',
      'backbone': 'backbone',
      'css': 'css',
      'text': 'text',
      // 'server':'../server',
      // 'router': '../router',
      'homejs':'../home/js/homejs'
    }
});
require(['backbone'],function(Backbone){
  var Router = Backbone.Router.extend({
    routes:{
      '':'home',
      'home':'home',
      'market':'market',
      'cart':'cart',
      'mine':'mine'
    },
    home: function(){
      require(['jquery','text!../home/home.html','css!../home/css/home.css','homejs'],function($,html,homejs){
        $('#main').html(html);
        console.log(homejs.sum(1,2));
      })
    },
	  market: function(){
	  	require(['jquery','text!../market/market.html','css!../market/css/market.css'],function($,html){
	       $('#main').html(html);
  	  })
    },
   cart: function(){
     require(['jquery','text!../cart/cart.html','css!../cart/css/cart.css'],function($,html){
       $('#main').html(html);
     })
   },
   mine: function(){
     require(['jquery','text!../mine/mine.html','css!../mine/css/mine.css'],function($,html){
       $('#main').html(html);
     })
   }
  });
  var router = new Router();
  Backbone.history.start();
})
